import Router from '@koa/router'
import {
    deleteOwnerByIdController,
    getOwnerPageController,
    postOwnerController,
    putOwnerByIdController,
    getOwnerOptionListController,
    getOwnerByIdController,
    updateOwnerExpireTimeController
} from '../controllers/owner'

const ownerRouter = new Router({
    prefix: '/owner',
})

// 用户的增删改查
ownerRouter.get('/', getOwnerPageController) // 获取用户列表
ownerRouter.get('/option-list', getOwnerOptionListController) // 获取用户列表
ownerRouter.get('/:id', getOwnerByIdController) // 获取用户列表
ownerRouter.post('/', postOwnerController) // 添加用户
ownerRouter.put('/:id', putOwnerByIdController) // 修改用户信息
ownerRouter.delete('/:id', deleteOwnerByIdController) // 删除用户
ownerRouter.get('/updateExpiretime', updateOwnerExpireTimeController) // 根据购买的天数更新车主信息
export default ownerRouter
